.class Lrexsee/storage/RexseeZIP$1;
.super Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
.source "RexseeZIP.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/storage/RexseeZIP;->gzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/storage/RexseeZIP;

.field private final synthetic val$source:Ljava/lang/String;

.field private final synthetic val$target:Ljava/lang/String;


# direct methods
.method constructor <init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    iput-object p2, p0, Lrexsee/storage/RexseeZIP$1;->val$source:Ljava/lang/String;

    iput-object p3, p0, Lrexsee/storage/RexseeZIP$1;->val$target:Ljava/lang/String;

    .line 169
    invoke-direct {p0}, Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;-><init>()V

    return-void
.end method


# virtual methods
.method public run()Z
    .locals 8

    .prologue
    const/4 v7, 0x0

    .line 172
    iget-object v4, p0, Lrexsee/storage/RexseeZIP$1;->val$source:Ljava/lang/String;

    invoke-static {v4}, Lrexsee/core/utilities/Utilities;->getContent(Ljava/lang/String;)[B

    move-result-object v0

    .line 173
    .local v0, "bContent":[B
    if-nez v0, :cond_0

    .line 174
    iget-object v4, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v4}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v4

    iget-object v5, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v5}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "Error on reading source file."

    invoke-virtual {v4, v5, v6}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v4, v7

    .line 191
    :goto_0
    return v4

    .line 177
    :cond_0
    iget-object v4, p0, Lrexsee/storage/RexseeZIP$1;->val$target:Ljava/lang/String;

    invoke-static {v4}, Lrexsee/core/utilities/Utilities;->prepareWriteFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v3

    .line 178
    .local v3, "targetFile":Ljava/io/File;
    if-nez v3, :cond_1

    .line 179
    iget-object v4, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v4}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v4

    iget-object v5, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v5}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "Error on creating GZIP file."

    invoke-virtual {v4, v5, v6}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v4, v7

    .line 180
    goto :goto_0

    .line 183
    :cond_1
    :try_start_0
    new-instance v2, Ljava/util/zip/GZIPOutputStream;

    new-instance v4, Ljava/io/FileOutputStream;

    invoke-direct {v4, v3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    invoke-direct {v2, v4}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 184
    .local v2, "gOut":Ljava/util/zip/GZIPOutputStream;
    invoke-virtual {v2, v0}, Ljava/util/zip/GZIPOutputStream;->write([B)V

    .line 185
    invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->flush()V

    .line 186
    invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->finish()V

    .line 187
    invoke-virtual {v2}, Ljava/util/zip/GZIPOutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 188
    const/4 v4, 0x1

    goto :goto_0

    .line 189
    .end local v2    # "gOut":Ljava/util/zip/GZIPOutputStream;
    :catch_0
    move-exception v4

    move-object v1, v4

    .line 190
    .local v1, "e":Ljava/lang/Exception;
    iget-object v4, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v4}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v4

    iget-object v5, p0, Lrexsee/storage/RexseeZIP$1;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v5}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5, v1}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v4, v7

    .line 191
    goto :goto_0
.end method
